package yifeng.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


/**
 * ??????????
 * @author pengyifeng
 *
 */
public class ThreadLocalTest {
	
	public static ThreadLocal<String> tag = new ThreadLocal<String>();
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ExecutorService es = Executors.newFixedThreadPool(5);
		
		for(int i = 0; i < 5; i++){
			es.submit(new Runner());
		}
		
		es.shutdown();
	}
	

	
}


class Runner implements Runnable{
	
	
	
	public Runner() {
		super();
	}

	@Override
	public void run() {
		ThreadLocalTest.tag.set(Thread.currentThread().getName());
		System.out.println(ThreadLocalTest.tag.get());
	}
}